_posts/2018-4-13-Announcing HTTP2 support in Azure App Service.html (75 lines of code) (raw):
---
title: "Announcing HTTP2 support in Azure App Service"
hide_excerpt: true
---
<html><head>
<meta charset="utf-8"/>
</head>
<body>
<div id="page">
<a class="url fn n profile-usercard-hover" href="https://social.msdn.microsoft.com/profile/Oded Dvoskin" target="_blank">Oded Dvoskin</a>
<time> 4/13/2018 10:00:02 AM</time>
<hr/>
<div id="content">The Azure App Service team is happy to announce the global deployment of support for the HTTP/2 protocol for all apps hosted on App Service. HTTP/2 has been the <a href="https://feedback.azure.com/forums/169385-web-apps/suggestions/9552936-enable-http-2-on-azure-web-apps">top customer request</a> we have received, and we are excited to light up support!
<h2>What is HTTP/2?</h2>
HTTP/2 is a rework of how HTTP semantics flow over TCP connections, and HTTP/2 support is present in Windows 10 and Windows Server 2016. HTTP/2 is a major upgrade after nearly two decades of HTTP/1.1 use and reduces the impact of latency and connection load on web servers.
The major advance of HTTP/1.1 was the use of persistent connections to service multiple requests in a row. In HTTP/2, a persistent connection can be used to service multiple simultaneous requests. In the process, HTTP/2 introduces several additional features that improve the efficiency of HTTP over the network.
<h3>One connection for multiple requests</h3>
Every TCP connection requires a round trip to set up. If you're using encryption, the TLS handshake takes another 1-2 round trips. All this happens before the first byte of the first response can be sent. By reusing an existing connection instead of setting up a new one, this overhead can be shared by many requests. HTTP/2 sharply reduces the need for a request to wait while a new connection is established, or wait for an existing connection to become idle. Because a single connection is multiplexed between many requests, the request can usually be sent immediately without waiting for other requests to finish.
<h3>Header compression with HPACK</h3>
HTTP has supported compression of data for ages. Headers, however, are sent as uncompressed text, with a lot of redundancy between requests. (Many of the longest headers are sent with exactly the same value on every request!) HTTP/2 introduces HPACK, a compression scheme for HTTP headers which reduces the redundancy between requests.
Compression also helps multiplexing, because requests are smaller. This enables clients to make many requests in their first packets on a connection, while TCP flow control windows are still small.
<strong>What are the key differences from HTTP/1.x?</strong>
<ul>
<li>HTTP/2 is binary</li>
<li>Fully multiplexed, instead of ordered and blocking</li>
<li>Ability to use one connection for parallelism</li>
<li>Has one TCP/IP connection</li>
<li>Uses header compression to reduce overhead</li>
</ul>
<h2>What action do App Service users need to take?</h2>
All you need is a just a simple configuration! HTTP/2 is disabled by default for all customers. However, if you would like to opt-in and apply HTTP/2 for your site, follow the steps below:
Through the Azure Portal, browse to your app and search for the "Application settings", where you will find the setting called "HTTP Version". Select 1.1 or 2.0 by your needs.
<a href="{{ site.baseurl }}/media/2018/04/http2portal.jpg"><img alt="" class="alignnone wp-image-8545" height="251" src="{{ site.baseurl }}/media/2018/04/http2portal-300x180.jpg" width="419"/></a>
You may also browse to the Azure Resource Explorer using one of the following steps:
<ol>
<li>In the <a href="https://portal.azure.com">Azure Portal</a>, select “Resource explorer” in your App Service app’s menu.</li>
</ol>
<a href="{{ site.baseurl }}/media/2018/03/1.png"><img alt="" class="alignnone size-medium wp-image-7615" height="300" src="{{ site.baseurl }}/media/2018/03/1-184x300.png" width="184"/></a>
Then select ‘Go’
<a href="{{ site.baseurl }}/media/2018/03/2.png"><img alt="" class="alignnone size-medium wp-image-7625" height="63" src="{{ site.baseurl }}/media/2018/03/2-300x63.png" width="300"/></a>
<ol start="2">
<li>Alternatively, browse directly to Resource Explorer (<a href="https://resources.azure.com/">https://resources.azure.com/</a>).</li>
</ol>
The advantage of going through the Azure Portal route is that the browser will be automatically navigated to your requested app’s configuration, then you just have to navigate to config > web, where you will find the needed value to update.
If browsing directly to Resource Explorer, drill down through the tree hierarchy to your site using the following path:
Subscription > Resource Group > your site name > Providers > Microsoft.Web > sites > your site name > config > web
<a href="{{ site.baseurl }}/media/2018/03/3.png"><img alt="" class="alignnone size-medium wp-image-7665" height="300" src="{{ site.baseurl }}/media/2018/03/3-206x300.png" width="206"/></a>
On the top of the page make sure you’re in Read/Write mode:
<a href="{{ site.baseurl }}/media/2018/03/4.png"><img alt="" class="alignnone size-full wp-image-7635" height="44" src="{{ site.baseurl }}/media/2018/03/4.png" width="211"/></a>
Select Edit:
<a href="{{ site.baseurl }}/media/2018/03/5.png"></a><a href="{{ site.baseurl }}/media/2018/03/select-edit.png"><img alt="" class="alignnone wp-image-7825 size-full" height="47" src="{{ site.baseurl }}/media/2018/03/select-edit.png" width="121"/></a>
Find the parameter for HTTP/2:
<a href="{{ site.baseurl }}/media/2018/03/6.png"><img alt="" class="alignnone size-medium wp-image-7685" height="34" src="{{ site.baseurl }}/media/2018/03/6-300x34.png" width="300"/></a>
Type in ‘<strong>true</strong>’ in place of ‘false’:
<a href="{{ site.baseurl }}/media/2018/03/7.png"><img alt="" class="alignnone size-medium wp-image-7655" height="32" src="{{ site.baseurl }}/media/2018/03/7-300x32.png" width="300"/></a>
On the top, select ‘PUT’:
<a href="{{ site.baseurl }}/media/2018/03/8.png"><img alt="" class="alignnone size-medium wp-image-7675" height="60" src="{{ site.baseurl }}/media/2018/03/8-300x60.png" width="300"/></a>
You’re done!
<ul>
<li>Support for HTTP/2 in App Service Environments and the Azure National Clouds is available as well!</li>
</ul>
<h2>HTTP/2 Browser Support Requires SSL</h2>
Most modern browsers only support using the HTTP/2 protocol over SSL, while non-SSL traffic continues to use HTTP/1.1. App Service makes it easy to get up and running with SSL. <a href="https://docs.microsoft.com/en-us/azure/app-service/web-sites-purchase-ssl-web-site">Learn how to configure</a> a new SSL cert for your app, or learn how to <a href="https://docs.microsoft.com/en-us/Azure/app-service/app-service-web-tutorial-custom-ssl">bind an existing SSL cert</a> to your app. App Service also provides a default level of SSL functionality for all apps via a common wildcard SSL certificate bound to the <em>*.azurewebsites.net</em> domain. Regardless of which approach you choose, your apps will need to run over SSL to enjoy the benefits of HTTP/2 with modern browsers.
<h2>What if I encounter an issue?</h2>
If you find an issue you suspect is stemming from the update to HTTP/2 you can alert us through the following methods:
<ul>
<li>Ask a question on the developer forums: <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=windowsazurewebsitespreview">MSDN</a> or <a href="https://stackoverflow.com/questions/tagged/azure-web-app-service">Stack Overflow</a></li>
<li>Open a <a href="https://portal.azure.com/">support ticket</a></li>
</ul></div>
</div></body>
<script src="{{ site.baseurl }}/resource/jquery-1.12.1.min.js" type="text/javascript"></script>
<script src="{{ site.baseurl }}/resource/replace.js" type="text/javascript"></script>
</html>